package ua.maxicash.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ua.maxicash.dao.GeoDao;
import ua.maxicash.vo.City;
import ua.maxicash.vo.Country;
import ua.maxicash.vo.Region;

import java.util.List;
import java.util.Set;

@Service("geoService")
public class GeoServiceImpl implements GeoService {

    @Autowired
    private GeoDao geoDao;

    @Override
    public void addCountry(Country country) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public void addRegion(Region region) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public void addCity(City city) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public List<Country> getAllCountries() {
        return geoDao.getAllCountries();
    }

    @Override
    public Set<Region> getAllRegionsOfCountry(Long idCountry) {
        return geoDao.getAllRegionsOfCountry(idCountry);
    }

    @Override
    public Set<City> getAllCitiesOfRegion(Long idRegion) {
    	return geoDao.getAllCitiesOfRegion(idRegion);
    }

	@Override
	public City getCityById(Long idCity) {
		
		return geoDao.getCityById(idCity);
	}

	@Override
	public Region getRegionById(Long idRegion) {
		
		return geoDao.getRegionById(idRegion);
	}

	@Override
	public Country getCountryById(Long idCountry) {
		
		return geoDao.getCountryById(idCountry);
	}

    @Override
    public List<City> getCitiesLike(String term) {

        return geoDao.getCitiesLike(term);

    }
}
